package com.fadadianqi.logistics.admin.staff.dao.ibatis;

import com.fadadianqi.logistics.admin.staff.dao.MasterDAO;
import com.fadadianqi.logistics.admin.staff.model.Master;
import com.fadadianqi.commons.GenericDAOSuport;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Component
public class MasterDAOImpl extends GenericDAOSuport<String, Master> implements
        MasterDAO {

    @Override
    public List<Master> findAll() {
        return super.findAll(null);
    }

    @Override
    public Master getByName(String name) {
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("name", name);
        return super.getByPropertys(map);
    }

    @Override
    protected Class<?> getObjectClass() {
        return Master.class;
    }

    @Override
    protected String getTableName() {
        return "master";
    }


}
